package com.android.pagemarket.business.model;

import org.json.JSONObject;

import com.android.pagemarket.io.protocol.out.InitInfo;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName="quot_type")
public class QuotType
{   
    /////////////////////////////////////////////////////
    // 协议参数
    @DatabaseField(id=true)
    public int qid;// 是 N 报价方式id
    @DatabaseField
    public String quotName;// 是 C 报价方式名称
    @DatabaseField(foreign=true,foreignAutoRefresh=true,columnName="init_id")
    public InitInfo initInfo;
    
    public static QuotType parse(JSONObject data,InitInfo initInfo) throws Exception
    {
        QuotType one = new QuotType();

        one.initInfo = initInfo;
        one.qid = data.getInt("qid");
        one.quotName = data.getString("quotName");

        return one;
    }

    @Override
    public String toString()
    {
        return quotName;
    }
}